package org.oims.simpleserver.utils;

import org.oims.simpleserver.entities.results.DataResult;
import org.oims.simpleserver.entities.results.ErrorResult;
import org.oims.simpleserver.entities.results.SuccessResult;

public class ReturnResultUtil {
    public static ErrorResult getErrorResult(int code, String msg){
        return new ErrorResult(code, msg);
    }

    public static ErrorResult getServerErrorResult(){
        return ReturnResultUtil.getErrorResult(500, "哎呀，搞错了，重来");
    }

    public static SuccessResult getSuccessResult(){
        return new SuccessResult();
    }

    public static DataResult getDataResult(Object data){
        return new DataResult(data);
    }
}
